<?php
declare (strict_types = 1);

namespace app\validate;

use think\Validate;

class MenuValidate extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名' =>  ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        'parent_id'   => 'require|number',
        'name'   => 'require|length:2,25',
        'path'   => 'require|length:1,45',
        'icon'   => 'length:2,25',
        'order'  => 'number',
        'status' => 'number|in:0,1',
        'is_log' => 'number|in:0,1',
        'remark' => 'length:1,250'
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名' =>  '错误信息'
     *
     * @var array
     */
    protected $message = [];
}
